package cn.wangliang181230.boot.unweb.applicationlistener;

import com.alibaba.fastjson.JSON;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

public class MyApplicationListener implements ApplicationListener<ApplicationEvent> {

	@Override
	public void onApplicationEvent(ApplicationEvent event) {
		System.out.println("\r\n\r\n---------------------------------- " + event.getClass().getSimpleName() + " ----------------------------------");
		try {
			System.out.println("event data: " + JSON.toJSONString(event));
		} catch (Throwable t) {
			System.out.println("event data: [parse event failed]");
		}
	}

}
